<template>
  <a-form-model v-bind="formItemLayout">
    <a-form-model-item label="出所日期">
      {{Object.keys(model).length > 0 && model.outDate?model.outDate:'--'}}
    </a-form-model-item>
    <a-form-model-item label="人员类型">
      {{Object.keys(model).length > 0 && model.personType?filterDictTextByCache(model.personType):'--'}}
    </a-form-model-item>
    <a-form-model-item label="风险等级评估日期">
      <a-alert type="warning" show-icon message="以出所时间为条件，系统自动生成该人员应该定期毛发检测的时间，每6个月1次检测；" />
    </a-form-model-item>
    <a-form-model-item label="定期毛发检测日期">
      <a-alert type="warning" show-icon message="以出所时间为条件，系统自动生成该人员应该定期毛发检测的时间，每6个月1次检测；" />
    </a-form-model-item>
  </a-form-model>
</template>

<script>
export default {
  props: ['value'],
  data() {
    return {
      model: {},
      formItemLayout: {
        labelCol: { span: 4 },
        wrapperCol: { span: 10 }
      },
      dictOptions: []
    }
  },
  computed: {
    getValue() {
      let value = this.value ? this.value : {}
      return value
    }
  },
  watch: {
    getValue: {
      immediate: true,
      deep: true,
      handler(val) {
        this.model = Object.assign({}, this.model, val)}
    }
  },
  created() {
    this.$initDictOptions('personType').then((res) => {
      if (res.success) {
        this.dictOptions = res.result
      }
    })
  },
  methods:{
    filterDictTextByCache(text) {
      return this.$filterDictText(this.dictOptions, text)
    }
  }
}
</script>

<style scoped lang="less">
</style>
